GdPicture.NET.14
GdPicture14 Namespace / GdPicturePDF Class / SearchText Method / SearchText(String,Int32,Boolean,Boolean,Boolean,RectangleF[]) Method
The text expression to search for.
The occurrence (rank) of the searched expression on the current page. Set the occurrence to 1 if you are searching for the first occurrence, set it to 2 for the second etc.

Rank equal to 0 is not accepted, it will always be converted to 1. Please note that the occurrence (rank) is always related to the current page.

Set this parameter to true if you want to apply case-sensitive search, otherwise set it to false.
Set this parameter to true if you want to search for the whole words only, otherwise set it to false.
Set this parameter to true if you want to search applying the ordinal (binary) sort rules, otherwise set it to false. An ordinal comparison compares strictly on the numeric character values, that means it does not respect accents.
Output parameter. If the searched expression has been found, this parameter will output array of rectangle areas that surround the occurrence in inches.





In This Topic
SearchText(String,Int32,Boolean,Boolean,Boolean,RectangleF[]) Method
In This Topic
Searches for an occurrence of a given text expression within the current page of the loaded PDF document according to the parameters you have specified. This method returns bounding box surrounding the searched expression or set of bounding boxes in case the searched expression spans across multiple lines, defined by its top left coordinates and by its width and height in inches, if the expression has been found.

You can benefit from selecting the comparison option using this method, in other words, you can search respecting accents or not in the given text expression.

Syntax
'Declaration
 
Public Overloads Function SearchText( _
   ByVal Text As String, _
   ByVal Occurrence As Integer, _
   ByVal CaseSensitive As Boolean, _
   ByVal WholeWords As Boolean, _
   ByVal OrdinalComparison As Boolean, _
   ByRef BoundingBoxes() As RectangleF _
) As Boolean
public bool SearchText( 
   string Text,
   int Occurrence,
   bool CaseSensitive,
   bool WholeWords,
   bool OrdinalComparison,
   ref RectangleF[] BoundingBoxes
)
public function SearchText( 
    Text: String;
    Occurrence: Integer;
    CaseSensitive: Boolean;
    WholeWords: Boolean;
    OrdinalComparison: Boolean;
   var  BoundingBoxes: RectangleFarray of
): Boolean; 
public function SearchText( 
   Text : String,
   Occurrence : int,
   CaseSensitive : boolean,
   WholeWords : boolean,
   OrdinalComparison : boolean,
   BoundingBoxes : RectangleF[]
) : boolean;
public: bool SearchText( 
   string* Text,
   int Occurrence,
   bool CaseSensitive,
   bool WholeWords,
   bool OrdinalComparison,
   ref RectangleF[]* BoundingBoxes
) 
public:
bool SearchText( 
   String^ Text,
   int Occurrence,
   bool CaseSensitive,
   bool WholeWords,
   bool OrdinalComparison,
   array<RectangleF>^% BoundingBoxes
) 

Parameters

Text
The text expression to search for.
Occurrence
The occurrence (rank) of the searched expression on the current page. Set the occurrence to 1 if you are searching for the first occurrence, set it to 2 for the second etc.

Rank equal to 0 is not accepted, it will always be converted to 1. Please note that the occurrence (rank) is always related to the current page.

CaseSensitive
Set this parameter to true if you want to apply case-sensitive search, otherwise set it to false.
WholeWords
Set this parameter to true if you want to search for the whole words only, otherwise set it to false.
OrdinalComparison
Set this parameter to true if you want to search applying the ordinal (binary) sort rules, otherwise set it to false. An ordinal comparison compares strictly on the numeric character values, that means it does not respect accents.
BoundingBoxes
Output parameter. If the searched expression has been found, this parameter will output array of rectangle areas that surround the occurrence in inches.

Return Value

true if the given text expression has been found on the current page according to the specified parameters, otherwise false. The GetStat method can be subsequently used to determine if this method has been successful.
Remarks
This method is only allowed for use with non-encrypted documents.

It is recommend to use the GetStat method to identify the specific reason for the method's failure, if any.

See Also